using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using T2.WebSecurity.Data.Controllers.Interfaces;
using T2.WebSecurity.Data.Entities.Interfaces;
using T2.WebSecurity.Business.Entities.Interfaces;
using T2.WebSecurity.Business.Entities;
using T2.WebSecurity.Data.Controllers;
using T2.WebSecurity.Business.Builders.Interface;
using T2.WebSecurity.Business.Translators;
using T2.WebSecurity.Business.Entities.Search.Interfaces;
using T2.WebSecurity.Data.Entities.Search.Interfaces;


//--Change Management Control - ApplicationProfileData Builder  --**********************
//--Created By: trooks
//--Description: ApplicationProfileData Builder Class
//--Created Date: 03/07/2013 10:49:13
//--*************************************************************

namespace T2.WebSecurity.Business.Builders
{
	public partial class ApplicationProfileData_Builder : IApplicationProfileData_builder 
	{
		
	public List<IApplicationProfileData_biz> BuildParts (IApplicationProfileData_biz _param)
	{
			IApplicationProfileData_biz temp = new ApplicationProfileData_biz();
			IApplicationProfileDataController cont = new ApplicationProfileDataController();
			List<IApplicationProfileData_biz> tempList = new List<IApplicationProfileData_biz>();
			List<IApplicationProfileData> tempData = new List<IApplicationProfileData>();
			switch (_param.Action)
			{
				case "GetOne":
				temp = ApplicationProfileDataTranslator.TranslateFromDataLayer(cont.ApplicationProfileData_GetOne(ApplicationProfileDataTranslator.TranslateToDataLayer(_param)));
				tempList.Add(temp);
				return tempList;

				case "GetAll":
				tempData = cont.ApplicationProfileData_GetAll(ApplicationProfileDataTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => ApplicationProfileDataTranslator.TranslateFromDataLayer(p)).Cast<IApplicationProfileData_biz>().ToList();
				return tempList;

				case "Application_ApplicationProfileData_ByParent":
				tempData = cont.Application_ApplicationProfileData_ByParent(ApplicationProfileDataTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => ApplicationProfileDataTranslator.TranslateFromDataLayer(p)).Cast<IApplicationProfileData_biz>().ToList();
				return tempList;

			}
			return tempList;
}
	public List<IApplicationProfileData_biz> BuildParts (IApplicationProfileDataSearch_biz _param)
	{
			IApplicationProfileData_biz temp = new ApplicationProfileData_biz();
			IApplicationProfileDataController cont = new ApplicationProfileDataController();
			List<IApplicationProfileData_biz> tempList = new List<IApplicationProfileData_biz>();
			List<IApplicationProfileData> tempData = new List<IApplicationProfileData>();
			tempData = cont.ApplicationProfileData_Search(ApplicationProfileDataTranslator.TranslateSearchToDataLayer(_param));
			tempList = tempData.Select(p => ApplicationProfileDataTranslator.TranslateFromDataLayer(p)).Cast<IApplicationProfileData_biz>().ToList();
			return tempList;

	}
		
	}
}
